TryTake Method

Task Parallel System.Threading

Attempts to remove and return an object from the IProducerConsumerCollection<(Of <(T>)>).

Namespace:  System.Collections.Concurrent
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Function TryTake ( _
	<OutAttribute> ByRef item As T _
) As Boolean
C#
bool TryTake(
	out T item
)

Parameters

item
Type: T %
When this method returns, if the object was removed and returned successfully, item contains the removed object. If no object was available to be removed, the value is unspecified.

Return Value

true if an object was removed and returned successfully; otherwise, false.

See Also